package com.yupi.springbootinit.autocommit;

import lombok.Data;

import java.io.File;
import java.util.regex.Matcher;

@Data
public class AutoCommitContext {
    /**
     * 客户svn内网仓库地址，外网应该也是可以的
     */
    private String projectUrl;
    private KBEnum kb;
    private DbType dbType;
    /**
     * 客户服务器本分文件路径
     */
    private String clientBakFilePath;
    /**
     * 客户本地仓库根路径
     */
    private String clientProjectPath;
    private String clientName;
    /**
     * 用来描述： 客户已经生成的文件列表 的文件的绝对路径
     */
    private String clientHasCreateFileListFileName;
    /**
     * 复制结果相对路径集合
     */
    private AutoCommit.FileActionResult fileActionResult;

    public AutoCommitContext(String projectUrl,String clientBakFilePath, KBEnum kb, DbType dbType) {
        this.projectUrl = projectUrl;
        this.kb = kb;
        this.dbType = dbType;
        this.clientBakFilePath = "smb:"+clientBakFilePath;


        String[] split = projectUrl.split("\\\\");
        if (split.length <= 1) {
            split = projectUrl.split("/");

        }
        this.clientName = split[split.length - 1].substring(1);
    }

}
